package com.seckill.entity;

import java.util.Date;

/**
 * @Creation_time 2017/9/6
 * @Theme 秒杀成功表
 * @Autor Xiao Yiyun
 */
public class Success {

    private int success_id;
    private int seckill_id;
    private String user_phone;
    private int success_status;
    private Date success_create_time;
    //复合属性
    //多对一的数据表关系中，在多的一方建立一的一方的实体类对象
    private Seckill seckill;

    public Seckill getSeckill() {
        return seckill;
    }

    public void setSeckill(Seckill seckill) {
        this.seckill = seckill;
    }

    public int getSuccess_id() {
        return success_id;
    }

    public void setSuccess_id(int success_id) {
        this.success_id = success_id;
    }

    public int getSeckill_id() {
        return seckill_id;
    }

    public void setSeckill_id(int seckill_id) {
        this.seckill_id = seckill_id;
    }

    public String getUser_phone() {
        return user_phone;
    }

    public void setUser_phone(String user_phone) {
        this.user_phone = user_phone;
    }

    public int getSuccess_status() {
        return success_status;
    }

    public void setSuccess_status(int success_status) {
        this.success_status = success_status;
    }

    public Date getSuccess_create_time() {
        return success_create_time;
    }

    public void setSuccess_create_time(Date success_create_time) {
        this.success_create_time = success_create_time;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Success success = (Success) o;

        if (success_id != success.success_id) return false;
        if (seckill_id != success.seckill_id) return false;
        if (success_status != success.success_status) return false;
        if (user_phone != null ? !user_phone.equals(success.user_phone) : success.user_phone != null) return false;
        return success_create_time != null ? success_create_time.equals(success.success_create_time) : success.success_create_time == null;

    }

    @Override
    public int hashCode() {
        int result = success_id;
        result = 31 * result + seckill_id;
        result = 31 * result + (user_phone != null ? user_phone.hashCode() : 0);
        result = 31 * result + success_status;
        result = 31 * result + (success_create_time != null ? success_create_time.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "Success{" +
                "success_id=" + success_id +
                ", seckill_id=" + seckill_id +
                ", user_phone='" + user_phone + '\'' +
                ", success_status=" + success_status +
                ", success_create_time=" + success_create_time +
                ", seckill=" + seckill +
                '}';
    }
}